﻿<Application
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
   x:Class="App"
   StartupUri="CmdletDesigner.xaml">
    <Application.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

        <!-- Errors on Tri-State check boxes -->
        <Style TargetType="{x:Type CheckBox}">
            <Setter Property="Validation.ErrorTemplate">
                <Setter.Value>
                    <ControlTemplate>
                        <StackPanel>
                            <AdornedElementPlaceholder Name="AdornedCheckBox" />
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="true">
                    <Setter Property="ToolTip"
                        Value="{Binding RelativeSource={RelativeSource Self}, 
                       Path=(Validation.Errors)[0].ErrorContent}"/>
                    <Setter Property="Background" Value="#FFAA5555" />
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- Errors on Tri-State textblocks -->
        <Style TargetType="{x:Type TextBox}">
            <Setter Property="Validation.ErrorTemplate">
                <Setter.Value>
                    <ControlTemplate>
                        <StackPanel>
                            <AdornedElementPlaceholder Name="AdornedCheckBox" />
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="true">
                    <Setter Property="ToolTip"
                        Value="{Binding RelativeSource={RelativeSource Self}, 
                       Path=(Validation.Errors)[0].ErrorContent}"/>
                    <Setter Property="Background" Value="#FFAA5555" />
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- Left nav Menu buttons -This is a RadioButton-->
		<Style x:Key="LeftMenuButtonRadio" TargetType="{x:Type RadioButton}">
			<Setter Property="SnapsToDevicePixels" Value="true"/>
			<Setter Property="FocusVisualStyle" Value="{DynamicResource RadioButtonFocusVisual}"/>
			<Setter Property="Background" Value="{DynamicResource NormalBrush}"/>
			<Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type RadioButton}" x:Name="ControlTemplate">
						<Grid x:Name="BackgroundGrid" >
							<Border x:Name="TextBorder" BorderThickness="1" >
								<TextBlock x:Name="Text" FontWeight="Bold"
										   TextWrapping="Wrap"><InlineUIContainer>
										<ContentPresenter Margin="5"/>
									</InlineUIContainer></TextBlock>
							</Border>
						</Grid>

						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="false">
								<Setter Property="FontWeight" TargetName="Text" Value="Normal"/>
							</Trigger>
              <Trigger Property="IsMouseOver" Value="true">
                <Setter TargetName="TextBorder" Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}"/>
                <Setter Property="Background" TargetName="Text">
                  <Setter.Value>
                    <LinearGradientBrush EndPoint="0.0,1.0" StartPoint="0.0,0.0">
                      <GradientStop Color="{DynamicResource {x:Static SystemColors.WindowColorKey}}" Offset="0.712"/>
                      <GradientStop Color="{DynamicResource {x:Static SystemColors.GradientInactiveCaptionColorKey}}" Offset="0.327"/>
                    </LinearGradientBrush>
                  </Setter.Value>
                </Setter>
              </Trigger>
              <Trigger Property="IsChecked" Value="true">
                <Setter TargetName="TextBorder" Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}"/>
                <Setter Property="Background" TargetName="Text">
                  <Setter.Value>
                    <LinearGradientBrush EndPoint="0.0,1.0" StartPoint="0.0,0.0">
                      <GradientStop Color="{DynamicResource {x:Static SystemColors.WindowColorKey}}" Offset="0.327"/>
                      <GradientStop Color="{DynamicResource {x:Static SystemColors.GradientInactiveCaptionColorKey}}" Offset="0.712"/>
                    </LinearGradientBrush>
                  </Setter.Value>
                </Setter>
              </Trigger>
              <Trigger Property="IsPressed" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="#80000000"/>
								<Setter Property="FontWeight" TargetName="Text" Value="Normal"/>
							</Trigger>

						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>


		<!-- This is the *foundation* for the template/style for the tabItems used to edit cmdlets. -->
    	<Style x:Key="TabItemFocusVisual">
    		<Setter Property="Control.Template">
    			<Setter.Value>
    				<ControlTemplate>
    					<Rectangle SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="3,3,3,1"/>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<SolidColorBrush x:Key="TabControlNormalBorderBrush" Color="#8C8E94"/>
    	<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
    		<GradientStop Color="#F3F3F3" Offset="0"/>
    		<GradientStop Color="#EBEBEB" Offset="0.5"/>
    		<GradientStop Color="#DDDDDD" Offset="0.5"/>
    		<GradientStop Color="#CDCDCD" Offset="1"/>
    	</LinearGradientBrush>
    	<LinearGradientBrush x:Key="TabItemHotBackground" EndPoint="0,1" StartPoint="0,0">
    		<GradientStop Color="#EAF6FD" Offset="0.15"/>
    		<GradientStop Color="#D9F0FC" Offset=".5"/>
    		<GradientStop Color="#BEE6FD" Offset=".5"/>
    		<GradientStop Color="#A7D9F5" Offset="1"/>
    	</LinearGradientBrush>
    	<SolidColorBrush x:Key="TabItemSelectedBackground" Color="#F9F9F9"/>
    	<SolidColorBrush x:Key="TabItemHotBorderBrush" Color="#3C7FB1"/>
    	<SolidColorBrush x:Key="TabItemDisabledBackground" Color="#F4F4F4"/>
    	<SolidColorBrush x:Key="TabItemDisabledBorderBrush" Color="#FFC9C7BA"/>

		<!-- This is the template/style for the tabItems used to edit cmdlets. -->
		<Style x:Key="TabItemCmdletEdit" TargetType="{x:Type TabItem}">
    		<Setter Property="FocusVisualStyle" Value="{StaticResource TabItemFocusVisual}"/>
    		<Setter Property="Foreground" Value="Black"/>
    		<Setter Property="Padding" Value="6,1,6,1"/>
    		<Setter Property="BorderBrush" Value="{StaticResource TabControlNormalBorderBrush}"/>
    		<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
    		<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    		<Setter Property="VerticalContentAlignment" Value="Stretch"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type TabItem}">
    					<Grid SnapsToDevicePixels="true">
    						<Border x:Name="Bd" BorderThickness="3,1,1,0" CornerRadius="8,5,1,0" Padding="{TemplateBinding Padding}">
    							<Border.Background>
    								<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
    									<GradientStop Color="{DynamicResource {x:Static SystemColors.MenuHighlightColorKey}}" Offset="0.005"/>
    									<GradientStop Color="#FFEBEBEB" Offset="0.5"/>
    									<GradientStop Color="#FFDDDDDD" Offset="0.5"/>
    									<GradientStop Color="#FFCDCDCD" Offset="1"/>
    									<GradientStop Color="#FFF2F2F2" Offset="0.062"/>
    								</LinearGradientBrush>
    							</Border.Background>
    							<Border.BorderBrush>
    								<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.ActiveCaptionColorKey}}"/>
    							</Border.BorderBrush>
    							<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" x:Name="Content" VerticalAlignment="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" ContentSource="Header" RecognizesAccessKey="True"/>
    						</Border>
    					</Grid>
    					<ControlTemplate.Triggers>
    						<Trigger Property="IsMouseOver" Value="true">
    							<Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemHotBackground}"/>
    						</Trigger>
    						<Trigger Property="IsSelected" Value="true">
    							<Setter Property="Panel.ZIndex" Value="1"/>
    							<Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemSelectedBackground}"/>
    						</Trigger>
    						<MultiTrigger>
    							<MultiTrigger.Conditions>
    								<Condition Property="IsSelected" Value="false"/>
    								<Condition Property="IsMouseOver" Value="true"/>
    							</MultiTrigger.Conditions>
    							<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource TabItemHotBorderBrush}"/>
    						</MultiTrigger>
    						<MultiTrigger>
    							<MultiTrigger.Conditions>
    								<Condition Property="IsSelected" Value="true"/>
    								<Condition Property="TabStripPlacement" Value="Top"/>
    							</MultiTrigger.Conditions>
    							<Setter Property="Margin" Value="-2,-2,-2,-1"/>
    							<Setter Property="Margin" TargetName="Content" Value="0,0,0,1"/>
    						</MultiTrigger>
    						<Trigger Property="IsEnabled" Value="false">
    							<Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemDisabledBackground}"/>
    							<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource TabItemDisabledBorderBrush}"/>
    							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
    						</Trigger>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>


		<!--	Style/template for all groupboxes used in the content areas like on cmdlet and parameter pages -->
		<Style TargetType="{x:Type GroupBox}">
			<Setter Property="BorderBrush" Value="#D5DFE5"/>
			<Setter Property="BorderThickness" Value="0,1,0,0"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type GroupBox}">
						<Grid Margin="0,10,0,20">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="6"/>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="6"/>
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="*"/>
								<RowDefinition Height="6"/>
							</Grid.RowDefinitions>
							<Border Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3" Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0"/>
							<Border x:Name="Header" Grid.Column="1" Grid.Row="0" Grid.RowSpan="1" Padding="0,1,3,0">
								<TextBlock x:Name="Text" FontWeight="Bold" TextWrapping="NoWrap" TextBlock.FontSize="16" ><InlineUIContainer>
										<ContentPresenter ContentSource="Header" RecognizesAccessKey="True" />
									</InlineUIContainer></TextBlock>
							</Border>
							<ContentPresenter Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" Margin="0,5,0,0"/>
							<Border Grid.ColumnSpan="4" Grid.Row="2" Grid.RowSpan="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>


<!-- Background brush for left nav panes-->
		<!-- LinearGradientBrush x:Key="LeftNavGradient" EndPoint="1,0.5" StartPoint="0,0.5">
			<GradientStop Color="#FF000000" Offset="1"/>
			<GradientStop Color="#FFFFFFFF" Offset="0.976"/>
			<GradientStop Color="#FF18AE17" Offset="0.986"/>
		</LinearGradientBrush -->

		<!-- Font color for all help text-->
		<SolidColorBrush x:Key="HelpTextFontColor" Color="#FF147513"/>
		
		<!-- Border color for menus-->
		<SolidColorBrush x:Key="DialogBorderColor" Color="#FF1C58B1"/>
		
	

<!-- Used on the Splash Screen (But not in the USR control. In the Main window -->
      <Style x:Key="LoadProjectButtonStyle" BasedOn="{x:Null}" TargetType="{x:Type Button}">
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type Button}">
              <Grid Width="Auto" Height="Auto">
                <Border x:Name="border" BorderBrush="#33FFFFFF" BorderThickness="1,1,1,1" CornerRadius="2,2,2,2" Padding="5,2,5,2" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch">
								<TextBlock FontSize="18" Foreground="#FFFFFFFF" x:Name="textBlock" Width="Auto" Height="Auto" HorizontalAlignment="Stretch" Margin="0,-1,0,0" VerticalAlignment="Stretch" ><InlineUIContainer>
										<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
											HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
											VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
									</InlineUIContainer></TextBlock>
							</Border>
              </Grid>
              <ControlTemplate.Triggers>
                <Trigger Property="IsFocused" Value="True"/>
                <Trigger Property="IsDefaulted" Value="True"/>
                <Trigger Property="IsMouseOver" Value="True">
                  <Setter Property="Foreground" TargetName="textBlock" Value="#FFFFFFFF"/>
                  <Setter Property="BorderBrush" TargetName="border" Value="#7FFFFFFF"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                  <Setter Property="Foreground" TargetName="textBlock" Value="#FF000000"/>
                  <Setter Property="BorderBrush" TargetName="border" Value="#FFFFFFFF"/>
                  <Setter Property="Background" TargetName="border" Value="#B2FFFFFF"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="False"/>
              </ControlTemplate.Triggers>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Style>
 <!-- END Used on the Splash Screen -->

<!-- Local toolbars (really dockpanels) -->
      <LinearGradientBrush x:Key="LocalToolbarGradient" EndPoint="0.995,0" StartPoint="0.995,1.004" MappingMode="RelativeToBoundingBox" SpreadMethod="Pad">
        <GradientStop Color="#FF267BC3" Offset="0.529"/>
        <GradientStop Color="#FF9FCBE8" Offset="0.962"/>
        <GradientStop Color="#FF5C9BD2" Offset="0.562"/>
        <GradientStop Color="#FFFFFFFF" Offset="1"/>
        <GradientStop Color="#FFA1C7FF" Offset="0.034"/>
        <GradientStop Color="#FF1C58B1" Offset="0.091"/>
        <GradientStop Color="#FFFFFFFF" Offset="0"/>
      </LinearGradientBrush>


      <Style x:Key="ButtonFocusVisual">
        <Setter Property="Control.Template">
          <Setter.Value>
            <ControlTemplate>
              <Rectangle SnapsToDevicePixels="true" Margin="2" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1"/>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Style>
   
      <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
      <Style x:Key="LocalToolbarButton" TargetType="{x:Type Button}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
        <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type Button}">
              <Border Width="Auto" Height="Auto" x:Name="border" BorderBrush="#7FFFFFFF" CornerRadius="2,2,2,2" Padding="5,2,5,2" BorderThickness="1,1,1,1">
							<TextBlock x:Name="textBlock" Foreground="#FFFFFFFF"><InlineUIContainer>
									<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" RecognizesAccessKey="True"/>
								</InlineUIContainer></TextBlock>
						</Border>
              <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                  <Setter Property="BorderBrush" TargetName="border" Value="#B2FFFFFF"/>
                  <Setter Property="BorderThickness" TargetName="border" Value="1,1,1,1"/>
                  <Setter Property="Background" TargetName="border" Value="#FFFFDBB4"/>
                  <Setter Property="Foreground" TargetName="textBlock" Value="#FF000000"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                  <Setter Property="Background" TargetName="border">
                    <Setter.Value>
                      <LinearGradientBrush EndPoint="0.508,1.012" StartPoint="0.508,0.022">
                        <GradientStop Color="#FFFFE8CF" Offset="0.938"/>
                        <GradientStop Color="#FFFFFFFF" Offset="1"/>
                        <GradientStop Color="#FFFF8400" Offset="0"/>
                        <GradientStop Color="#FFFFBB73" Offset="0.178"/>
                      </LinearGradientBrush>
                    </Setter.Value>
                  </Setter>
                  <Setter Property="BorderBrush" TargetName="border" Value="#FFFFFFFF"/>
                  <Setter Property="Foreground" TargetName="textBlock" Value="#FF000000"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                  <Setter Property="Foreground" Value="#FF555555"/>
                  <Setter Property="Background">
                    <Setter.Value>
                      <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                        <GradientStop Color="#FFF3F3F3" Offset="0"/>
                        <GradientStop Color="#FFEBEBEB" Offset="0.827"/>
                        <GradientStop Color="#FFDDDDDD" Offset="0.212"/>
                        <GradientStop Color="#FFCDCDCD" Offset="1"/>
                      </LinearGradientBrush>
                    </Setter.Value>
                  </Setter>
                  <Setter Property="Foreground" TargetName="textBlock" Value="#FF474747"/>
                </Trigger>
              </ControlTemplate.Triggers>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Style>
    	<LinearGradientBrush x:Key="NavigationBorder" EndPoint="1,0.5" StartPoint="0,0.5">
    		<GradientStop Color="#FF76AEDB" Offset="1"/>
    		<GradientStop Color="#FF226EBC" Offset="0"/>
    	</LinearGradientBrush>
<!-- END Local toolbars (really dockpanels) -->



    </Application.Resources>
</Application>